package com.hzhjhh.view.manageView.menus.storage.enums;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 菜单栏初始化-查询-查询商品信息-展示字段映射enum
 * 
 * @author 12083
 *
 */
@Getter
@AllArgsConstructor
public enum AddGoodsShowEnum {

	CODE("code", "商品编码"),
	TREATY_CODE("treatyCode", "条形码"),
	SORT_ID("sortId", "类别编号"),
	NAME("name", "商品名称"),
	RETAIL_PRICE("retailPrice", "零售价（元）"),
	SPEC("spec", "商品规格"),
	UNITS("units", "计量单位"),
	PURCHASE_PRICE("purchasePrice", "进货价"),
	REMARK("remark", "备注"),
	;
	
	/**
	 * 列对应的code
	 */
	private final String columnCode;
	/**
	 * 列展示时候的名称
	 */
	private final String columnName;
	
	public static Map<String, String> descMap() {
		return Arrays.asList(AddGoodsShowEnum.values())
				.stream()
				.collect(Collectors.toMap(AddGoodsShowEnum::getColumnName, AddGoodsShowEnum::getColumnCode, (v1, v2) -> v1));
	}
}
